UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C21Ab9rWqsDt7HGudJxboz6CYKabABxJtXdkmwUIxVk=' 
WHERE 
  key_id = '32b696083b1401734976314148043c379af2e328e767e81eba9a00006b530399' 
  AND (
    token = 'C21Ab9rWqsDt7HGudJxboz6CYKabABxJtXdkmwUIxVk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022