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

Query time 0.00027