UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jIKivn0DvoPEwVuVfNIX2bfkrByvZYyTApV6liYcB/w=' 
WHERE 
  key_id = '2852386fec28b0245e6494a8fec29ffc5f12ebcc16aabc0881e48e4d07192fd8' 
  AND (
    token = 'jIKivn0DvoPEwVuVfNIX2bfkrByvZYyTApV6liYcB/w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036