UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U/F8Eb7Epk5H1oBskLGygIKCvT+iqcD+vDdn2ZQASbc=' 
WHERE 
  key_id = 'd9214ed9462c07888f3f0ca973bd15a6ed6cb08582a49ea06411a96f2f02bc6a' 
  AND (
    token = 'U/F8Eb7Epk5H1oBskLGygIKCvT+iqcD+vDdn2ZQASbc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033