UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DRSfMC/TlAlxVH7OiBBjshwFFDbB/ql+MBLNdH5PSFQ=' 
WHERE 
  key_id = '35ab0d04599fc23ae0c3a8e412ca1e4434fc99d4cf5e6f942da13fba68426512' 
  AND (
    token = 'DRSfMC/TlAlxVH7OiBBjshwFFDbB/ql+MBLNdH5PSFQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034