UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AppgWf+gM99Tacrvoy7R2bqUVrKHAPtvBHPpLqf52zU=' 
WHERE 
  key_id = '81ad21d2a07aafba54e664d68a39e1d7a3d9eb2f630f98cc8846afb942807e97' 
  AND (
    token = 'AppgWf+gM99Tacrvoy7R2bqUVrKHAPtvBHPpLqf52zU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024