UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l/XvhS+YCMC2kYTQQo0aMxbmhPjLt8pYnhwO/xKSiZM=' 
WHERE 
  key_id = '06c77fce7ac301631a84e4385e2ac62901ed78e05bb445e4a15fd18ab3fa4c69' 
  AND (
    token = 'l/XvhS+YCMC2kYTQQo0aMxbmhPjLt8pYnhwO/xKSiZM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031