UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LtMqLETag4DVEeNxAs5vEc7C6j+ZhhYyxaI9HrO+oKw=' 
WHERE 
  key_id = '2e8d3b0e0a8ebbe876e1a525e811766438cf85df21c71fdbce67ec87422b8259' 
  AND (
    token = 'LtMqLETag4DVEeNxAs5vEc7C6j+ZhhYyxaI9HrO+oKw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022