UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GRPbXesjHxUJrOuW9v9cN0NWIwc+83aon6Y4Y0OcbQg=' 
WHERE 
  key_id = 'd2270157af0ca512d16a523fedf302c40056bd34a26e8cd73de7f72e40389e88' 
  AND (
    token = 'GRPbXesjHxUJrOuW9v9cN0NWIwc+83aon6Y4Y0OcbQg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051