UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cmTUkdGumjJ9WcyuNTU4N5L9UT4EY3p6Srj+yXLkUGo=' 
WHERE 
  key_id = '185031cea9cda7971893ed39372b005d54cd8168ae49dc7f26cf8f72d6aa6f6e' 
  AND (
    token = 'cmTUkdGumjJ9WcyuNTU4N5L9UT4EY3p6Srj+yXLkUGo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023