UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xoJ+sykus1B8N1vSeMqzKTFnTe6mUDr+Vp0xaxbpLZg=' 
WHERE 
  key_id = 'f70b5d6cfdfa8c64c61ffac0f6dd4a87d165a82ce07f929901297f2b31a15f67' 
  AND (
    token = 'xoJ+sykus1B8N1vSeMqzKTFnTe6mUDr+Vp0xaxbpLZg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032