UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9mIRwf1KhRUgrWYeG1zyziMcBBgCC0GrzKmwPALoytQ=' 
WHERE 
  key_id = '3eaa433b05880a4ee70095d915edcfd01dd49f5303f2b5042b6ff897826a8791' 
  AND (
    token = '9mIRwf1KhRUgrWYeG1zyziMcBBgCC0GrzKmwPALoytQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034