UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mUj/u1p/Ccur2H0mwNOJzuUfeNwll7mUpN9OyeBEfKg=' 
WHERE 
  key_id = '79d4e6023fa6181be5a1e68c67265b14743749c6de9a0f10053edc578e101028' 
  AND (
    token = 'mUj/u1p/Ccur2H0mwNOJzuUfeNwll7mUpN9OyeBEfKg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036