UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'flWv45lDUa+9Lbt/bPWK2XJ1pINaerZlOh6CrpLResI=' 
WHERE 
  key_id = '4038b3b4a74b69de3dd19ffeb36a0d5314e48ac1ab534f49313bf4707882bf27' 
  AND (
    token = 'flWv45lDUa+9Lbt/bPWK2XJ1pINaerZlOh6CrpLResI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014