UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1WeKdyddIqywqpQZpCbqiYoJ7WhITzHOxio3x7RQvqs=' 
WHERE 
  key_id = 'a33dc4c6fac980c9abf23fcfe7d52b7884b633eb17e0e2416da526cee2f23c7d' 
  AND (
    token = '1WeKdyddIqywqpQZpCbqiYoJ7WhITzHOxio3x7RQvqs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033