UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g8GexyBg7X/CUUSd20ZI3E14NbCihp7OOJm6xG7JdZM=' 
WHERE 
  key_id = '087e3bbd0eabf21bcfdeaa1d78f561ed2a29afb3d77bc1a217af85846550e3ec' 
  AND (
    token = 'g8GexyBg7X/CUUSd20ZI3E14NbCihp7OOJm6xG7JdZM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031