UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yq4MVJEQXEhinAIrAnMo9iUC6Nsh+ASB6jlynFfx39Q=' 
WHERE 
  key_id = '0d85ddffefa29914b3ad0d3bd74e346c0d7033c993db17a2c39f9031e627c2e8' 
  AND (
    token = 'yq4MVJEQXEhinAIrAnMo9iUC6Nsh+ASB6jlynFfx39Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043