UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5rTcDXQ4zJIkUGGAHl885NQxyCztwiR58ngqGoqZwP0=' 
WHERE 
  key_id = '8bb30a724efc8bf24cdabe1fc0489af3ba23e568860a0ed6023b5b89ced4ab5d' 
  AND (
    token = '5rTcDXQ4zJIkUGGAHl885NQxyCztwiR58ngqGoqZwP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029