UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fvd5XsnKmFBqjJ4/E4+r4q7etUTb1Oik+QMGjFxxVsw=' 
WHERE 
  key_id = 'f77b8b5b4dfc995f99f2fe71c509c65426586897560b3a849a261a226ce7626a' 
  AND (
    token = 'Fvd5XsnKmFBqjJ4/E4+r4q7etUTb1Oik+QMGjFxxVsw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056