UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BKKGIDufnOAazVhFh1Tm+IWBLMzshQjqXhxjtwrAAJA=' 
WHERE 
  key_id = '57458b85b7b1f47d4cb640157f4edd3ec0e662829d407b8f46bb093bd4355ec3' 
  AND (
    token = 'BKKGIDufnOAazVhFh1Tm+IWBLMzshQjqXhxjtwrAAJA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038