UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RMcj3Ha/gq4BoNGw7qqOnfkXqVdhbDc8XxKnGS+0Xz8=' 
WHERE 
  key_id = 'b4e84106a38f5ae7dc2c23d309d01b24da7d623130f87f5e78da7e866ae70fdb' 
  AND (
    token = 'RMcj3Ha/gq4BoNGw7qqOnfkXqVdhbDc8XxKnGS+0Xz8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015