UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cH+RowshKhqBQR2op/VsRDhY0nHlXj/A67doYlKjIaI=' 
WHERE 
  key_id = '47d9180dde23cb7431dda1af91dc63f0fdaa898af6d842669f8591ad51203bb7' 
  AND (
    token = 'cH+RowshKhqBQR2op/VsRDhY0nHlXj/A67doYlKjIaI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035