UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vk60CeYuqnbdTHWEsryHkCvkkE1I96DgF0B3kzX5/ls=' 
WHERE 
  key_id = '7b990c7b68201a1f1facf87c0490e532060992f88e3e4d1db18580cd88d79ee0' 
  AND (
    token = 'vk60CeYuqnbdTHWEsryHkCvkkE1I96DgF0B3kzX5/ls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048