UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xW1qrR9pD0ObQ/KIa4FCOU7Zn/29Yunyg84L37tYLwU=' 
WHERE 
  key_id = '3fe15ab413a7a249c8cf621ecf82e6dabccb9fab9f8d5fff577aebe6c2b4dcfd' 
  AND (
    token = 'xW1qrR9pD0ObQ/KIa4FCOU7Zn/29Yunyg84L37tYLwU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045