UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eD5D9SOaO8kj5xgwkansh3Bm86Vq5bWCbu1kcdo+KQw=' 
WHERE 
  key_id = '28745803191f57f9a7a13a94261df82fd12f04516224add3f950b38d4c2b9e6b' 
  AND (
    token = 'eD5D9SOaO8kj5xgwkansh3Bm86Vq5bWCbu1kcdo+KQw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020