UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X0WSt8VxMimyCp0uBlJv6y3lUyaKPq1JZKaOPyHvudQ=' 
WHERE 
  key_id = '0643be9fd26d337c1e67c4a8bdf9109bd75fa1e54cc7b119fe393743c35fd6ed' 
  AND (
    token = 'X0WSt8VxMimyCp0uBlJv6y3lUyaKPq1JZKaOPyHvudQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040