UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't4cXkISXTLtHHVRFAASxvlohUkP6hgNHv5SqbZYhG58=' 
WHERE 
  key_id = '5c13b5e56bcb6ef51471d297f56155e25495844079a5471ad226f767b5fcfba2' 
  AND (
    token = 't4cXkISXTLtHHVRFAASxvlohUkP6hgNHv5SqbZYhG58=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040