UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1qMKR9+KTvFEJQn++OcdI+z33iTXm8drUW/b/+K0qrE=' 
WHERE 
  key_id = '39d5b12fabda105171752f425cd90acc4bb3489a0849a5ceddeb29ccdc8c71a9' 
  AND (
    token = '1qMKR9+KTvFEJQn++OcdI+z33iTXm8drUW/b/+K0qrE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020