UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qTOdtPqW2zSeLP/+xDQ8Z/0wXcxOqDFEuq2d8fYaNo8=' 
WHERE 
  key_id = 'b7e44cc4da40610be6ad89e1dba48a6afffad3e371589c46d5e735e7d99888eb' 
  AND (
    token = 'qTOdtPqW2zSeLP/+xDQ8Z/0wXcxOqDFEuq2d8fYaNo8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032