UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RhJ48JGsWQGeqIIoLnJO6mqDakmnHPkYvwwWNGmlomw=' 
WHERE 
  key_id = 'a6a4203f119cd327802afae02c4a9ba483e9e1313bf25b782e18cb1c7f0ec3df' 
  AND (
    token = 'RhJ48JGsWQGeqIIoLnJO6mqDakmnHPkYvwwWNGmlomw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029