UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dUw8RuuEKSxcztqnpAnY01dTOrqRyEKNcFJ/woJRznk=' 
WHERE 
  key_id = '8b0a0a8db16e98ac7ad68ab94736ceea829b74e1eb46f5e41a6e8ae24ed6c33c' 
  AND (
    token = 'dUw8RuuEKSxcztqnpAnY01dTOrqRyEKNcFJ/woJRznk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025