UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/kITwf9x3t/6J44xB9kDB4spSZVJ9tvqEP1mPOXM3Fw=' 
WHERE 
  key_id = '272d83e9920c506a296b0795bf183c6b31c7494713ba5ca7363bb734350c774e' 
  AND (
    token = '/kITwf9x3t/6J44xB9kDB4spSZVJ9tvqEP1mPOXM3Fw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032